package br.ufrn.imd.classificados.activity;

import java.util.ArrayList;

import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
import br.ufrn.imd.classificados.adapter.ItemAdapter;
import br.ufrn.imd.classificados.dominio.Item;
import br.ufrn.imd.imd0023_classificados.R;

import com.actionbarsherlock.app.SherlockActivity;
import com.actionbarsherlock.view.Menu;

public class HistoricoTransacoesActivity extends SherlockActivity implements OnItemClickListener {
	private ListView listView;
	private ItemAdapter adapterListView;
	private ArrayList<Item> historicoItens;
	
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		return super.onCreateOptionsMenu(menu);
	}
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		setContentView(R.layout.historico_listview);
		
		listView = (ListView) findViewById(R.id.historico_transacoes);
		listView.setOnItemClickListener(this);
		
		createListView();
	}

	private void createListView() {
		historicoItens = new ArrayList<Item>();
		
		Item item1 = new Item("Notebook");
		//ImageView sit1 = (ImageView) findViewById(R.id.situacaoItemHist);
		//sit1.setImageResource(R.drawable.vendido);

		//sit1.setVisibility(View.VISIBLE);
		
		historicoItens.add(item1);

		adapterListView = new ItemAdapter(this, historicoItens);
		
		listView.setAdapter(adapterListView);
	}

	@Override
	public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
		// TODO Auto-generated method stub
		
	}
}
